import 'package:aihu_getx_app/app/modules/commons/model/common_page_resp_model.dart';
import 'package:aihu_getx_app/app/modules/d/d_member/d_member_vipuser_index/models/vip_user_page_req_vo.dart';
import 'package:aihu_getx_app/app/modules/d/d_member/d_member_vipuser_index/models/vip_user_resp_vo.dart';
import 'package:aihu_getx_app/providers/http_provider.dart';

class DMemberVipuserProvider {
  static Future<CommonPageRespModel<VipUserRespVO>> page(
      VipUserPageReqVO form) async {
    var response = await Http.get(
      "/member/vip-user/page",
      queryParameters: form.toJson(),
      fromJsonT: (json) {
        return CommonPageRespModel.fromJson(json, (json) {
          return VipUserRespVO.fromJson(json);
        });
      },
    );
    return Future(() => response);
  }

  static Future<bool> update(VipUserRespVO form) async {
    var response = await Http.put(
      "/member/vip-user/update",
      data: form.toJson(),
      fromJsonT: (json) {
        return json;
      },
    );
    return Future(() => response);
  }
}
